package hust.ning.util
{
	import flash.external.ExternalInterface;
	
	public class URLParser
	{
		public function URLParser()
		{
			
		}
		
		public static function getParams():Object {
            var params:Object = {};
            var query:String = ExternalInterface.call("window.location.href.toString");
            query= query.substr(query.indexOf("?")+1);
            //query = "origin=104&xn_sig_in_iframe=1&xn_sig_method=get&xn_sig_time=1240943093258&xn_sig_added=1&xn_sig_user=913635539&xn_sig_session_key=2.87d2ce3e5baf2eea7d194f00b031ec5f.3600.1240948800-913635539&xn_sig_expires=0&xn_sig_api_key=9efcae555af746f58d14e7e8df5e310d&xn_sig_app_id=29593";
            if(query) {
                var pairs:Array = query.split("&");
                for(var i:uint=0; i < pairs.length; i++) {
                	var pair :Array = pairs[i].split("=");
                	params[pair[0]]=pair[1];
           		}
           	}
            return params;
		}
	}
}